#1.install depends

sudo apt-get update  

sudo apt-get install libssl-dev -y
sudo apt-get install libxinerama-dev -y
sudo apt-get install libxcursor-dev -y

sudo apt-get install git libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev -y

# sudo apt-get install -y git libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev   
echo 安装构建 librealsense 库所需的核心包
sudo apt-get install -y libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev   
echo  Ubuntu 18 安装特定于发行版的软件包
sudo apt-get install python3-dev -y

sudo apt-get install librealsense2-dkms
sudo apt-get install librealsense2-utils
sudo apt-get install librealsense2-dev
sudo apt-get install librealsense2-dbg
sudo apt-key adv --keyserver keys.gnupg.net --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE
#记得先右击该文件打开终端
 
# sudo apt-key adv --keyserver keys.gnupg.net --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE
 
sudo add-apt-repository "deb http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo xenial main" -u
 
sudo apt-get install librealsense2-dkms
sudo apt-get install librealsense2-utils
sudo apt-get install librealsense2-dev
sudo apt-get install librealsense2-dbg
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade
sudo update-grub && sudo reboot
sudo apt-get install git libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev
sudo apt-get install libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev
sudo cp config/99-realsense-libusb.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules && udevadm trigger
./scripts/patch-realsense-ubuntu-lts.sh
mkdir build && cd build
cmake ../
DCMAKE_BUILD_TYPE=Release
cmake ../ -DBUILD_EXAMPLES=true
sudo make uninstall && make clean && make && sudo make install
realsense-viewer
#mkdir build
cd ..
unzip librealsense-src.zip
cd librealsense-src/build
#cmake ../ -DBUILD_PYTHON_BINDINGS:bool=true -DPYTHON_EXECUTABLE=/usr/bin/python3
#make -j4
sudo make install
echo export PYTHONPATH=$PYTHONPATH:/usr/local/lib:/usr/local/lib/python3.6/pyrealsense2 >> ~/.bashrc
source ~/.bashrc

sudo cp config/99-realsense-libusb.rules /etc/udev/rules.d
sudo udevadm control --reload-rules && udevadm trigger

cd ..
#3.compile
./scripts/patch-realsense-ubuntu-L4T.sh

#4.
./scripts/setup_udev_rules.sh

pip3 install pyrealsense2-aarch64

chmod +x ./scripts/*.sh

./scripts/setup_udev_rules.sh


